package com.mgvlife.ddlw.vo;

import com.mgvlife.ddlw.entity.Clazz;
import com.mgvlife.ddlw.entity.Schedule;

public class VoSchedule {
	private String id;
	private String courseName;
	private String clazzTime;
	private String status;
	private String adminName;
	private String clazzs;

	public VoSchedule(Schedule schedule) {
		this.id = schedule.getId();
		this.courseName = schedule.getCourse().getName();
		this.clazzTime = schedule.getClazzTime();
		this.status = String.valueOf(schedule.getStatus());
		this.adminName = schedule.getAdmin() == null ? "无" : schedule
				.getAdmin().getName();
		this.clazzs = "";
		for (int i = 0; i < schedule.getClazzs().size(); i++) {
			Clazz clazz = schedule.getClazzs().get(i);
			if (i != schedule.getClazzs().size() - 1) {
				this.clazzs += clazz.getGrade() + clazz.getMajor()
						+ clazz.getClazzNum() + "   /   ";
			} else {
				this.clazzs += clazz.getGrade() + clazz.getMajor()
						+ clazz.getClazzNum();
			}
		}
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public String getClazzTime() {
		return clazzTime;
	}

	public void setClazzTime(String clazzTime) {
		this.clazzTime = clazzTime;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAdminName() {
		return adminName;
	}

	public void setAdminName(String adminName) {
		this.adminName = adminName;
	}

	public String getClazzs() {
		return clazzs;
	}

	public void setClazzs(String clazzs) {
		this.clazzs = clazzs;
	}

}
